/**
 * 
 */
package com.rs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rs.dao.ZhGoOutMapper;
import com.rs.model.ZhGoOut;
import com.rs.service.ZhGoOutService;
import com.rs.util.DateFormatUtil;

/**
 * @author zjw
 *
 */
@Service
@Transactional
public class ZhGoOutServiceImpl implements ZhGoOutService {

	
	@Autowired
	private ZhGoOutMapper gooutmapper;
	
	/**
	 * @version:
	 * @Description:
	 * @author:zjw
	 * @date:2020年8月6日
	 * @param goAudit
	 * @return
	 */
	@Override
	public PageInfo<ZhGoOut> selectGoOutAudit(ZhGoOut goout) {
		PageHelper.startPage(goout.getPageNum(), 10);
		List<ZhGoOut> list = gooutmapper.selectGoOutAudit(goout);
		for(ZhGoOut go : list){
			if(go.getGoKtime() != null){
				go.setGoKtimes(DateFormatUtil.getDateStringw(go.getGoKtime(), "yyyy-MM-dd hh:mm:ss"));
			}
			if(go.getGoJtime() != null){
				go.setGoJtimes(DateFormatUtil.getDateStringw(go.getGoJtime(), "yyyy-MM-dd hh:mm:ss"));
			}			
		}
		PageInfo<ZhGoOut> pageinfo = new PageInfo<>(list);
		return pageinfo;
	}

	/**
	 * @version:
	 * @Description:
	 * @author:zjw
	 * @date:2020年8月7日
	 * @param record
	 * @return
	 */
	@Override
	public int updateGoOutAudit(ZhGoOut record) {
		
		return gooutmapper.updateGoOutAudit(record);
	}

}
